/*
 * @Author: 吴世扬 18368095041@163.com
 * @Date: 2022-10-09 17:24:38
 * @LastEditors: 吴世扬 18368095041@163.com
 * @LastEditTime: 2022-10-10 11:31:11
 * @FilePath: /vue3-datav/src/api/login.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import request from '@/utils/request';

// 登录方法
export function login(username: string, password: string, code: string, uuid: string) {
    const data = {
        userName: username,
        password,
        captcha: code,
        uuid
    };
    return request({
        url: '/login',
        method: 'post',
        data
    });
}

// 获取用户详细信息
export function getUserInfo() {
    return request({
        url: '/admin/system/getInfo',
        method: 'get'
    });
}

// 退出方法
export function logout() {
    return request({
        url: '/logout',
        method: 'post'
    });
}
// 获取验证码
export function getCodeImg() {
    return request<any, string>({
        url: '/captcha',
        method: 'get'
    });
}
